package com.hzj.recipe.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 步骤表
 * @TableName step
 */
@TableName(value ="step")
@Data
public class Step implements Serializable {
    /**
     * 步骤id
     */
    @TableId(value = "step_id")
    private Integer stepId;

    /**
     * 食谱id
     */
    @TableField(value = "recipe_id")
    private Integer recipeId;

    /**
     * 步骤内容
     */
    @TableField(value = "steps_content")
    private String stepsContent;

    /**
     * 图片
     */
    @TableField(value = "steps_img")
    private String stepsImg;

    /**
     * 排序号
     */
    @TableField(value = "steps_sort")
    private Integer stepsSort;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Step other = (Step) that;
        return (this.getStepId() == null ? other.getStepId() == null : this.getStepId().equals(other.getStepId()))
            && (this.getRecipeId() == null ? other.getRecipeId() == null : this.getRecipeId().equals(other.getRecipeId()))
            && (this.getStepsContent() == null ? other.getStepsContent() == null : this.getStepsContent().equals(other.getStepsContent()))
            && (this.getStepsImg() == null ? other.getStepsImg() == null : this.getStepsImg().equals(other.getStepsImg()))
            && (this.getStepsSort() == null ? other.getStepsSort() == null : this.getStepsSort().equals(other.getStepsSort()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getStepId() == null) ? 0 : getStepId().hashCode());
        result = prime * result + ((getRecipeId() == null) ? 0 : getRecipeId().hashCode());
        result = prime * result + ((getStepsContent() == null) ? 0 : getStepsContent().hashCode());
        result = prime * result + ((getStepsImg() == null) ? 0 : getStepsImg().hashCode());
        result = prime * result + ((getStepsSort() == null) ? 0 : getStepsSort().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", stepId=").append(stepId);
        sb.append(", recipeId=").append(recipeId);
        sb.append(", stepsContent=").append(stepsContent);
        sb.append(", stepsImg=").append(stepsImg);
        sb.append(", stepsSort=").append(stepsSort);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}